package com.csd.action.manager;

import java.util.List;
import com.csd.helper.ActionResult;
import com.csd.helper.ProjectState;
import com.csd.service.IProjectService;
import com.csd.vo.ProjectVO;

/**
 * 管理员未处理的项目申请
 * @author sanmu
 *	<br> 创建于2009-12-25
 */
public class ProjectApplyUnhandleListAction {
	
	private List<ProjectVO> unhandleList;

	/** 前期，中期还是后期 */
	private String stage;
	
	private IProjectService projectService;

	public List<ProjectVO> getUnhandleList() {
		return unhandleList;
	}

	public void setUnhandleList(List<ProjectVO> unhandleList) {
		this.unhandleList = unhandleList;
	}

	public String getStage() {
		return stage;
	}

	public void setStage(String stage) {
		this.stage = stage;
	}

	public IProjectService getProjectService() {
		return projectService;
	}

	public void setProjectService(IProjectService projectService) {
		this.projectService = projectService;
	}
	
	public String execute()throws Exception
	{
		String text = ActionResult.fail;
		String state = "";
		
		if(stage.equals("1"))
			state = ProjectState.apply;
		else if(stage.equals("2"))
			state = ProjectState.prophasePass;
		else if(stage.equals("3"))
			state = ProjectState.telophasePass;
		else
			return text;
		
		//管理员未处理的项目申请列表
		unhandleList = projectService.listUnhandleProject(state);
		text = ActionResult.success;
		return text;
	}
}
